package vip.xiaonuo.biz.modular.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import vip.xiaonuo.common.pojo.DbEnum;
import vip.xiaonuo.biz.modular.pojo.domain.BizGoodsAttribute;
import vip.xiaonuo.biz.modular.service.BizGoodsAttributeService;
import vip.xiaonuo.biz.modular.mapper.BizGoodsAttributeMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author LancerAdmin
* @description 针对表【biz_goods_attribute(商品属性表)】的数据库操作Service实现
* @createDate 2024-02-29 14:54:24
*/
@Service
public class BizGoodsAttributeServiceImpl extends ServiceImpl<BizGoodsAttributeMapper, BizGoodsAttribute>
    implements BizGoodsAttributeService{

    @Override
    public List<BizGoodsAttribute> getAttributeByGoodsId(String goodsId){
        LambdaQueryWrapper<BizGoodsAttribute> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(BizGoodsAttribute::getGoodsId,goodsId);
        return this.list(queryWrapper);
    }
    @Override
    public List<BizGoodsAttribute> getAttributeINTRODUCTIONByGoodsId(String goodsId){
        LambdaQueryWrapper<BizGoodsAttribute> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(BizGoodsAttribute::getGoodsId,goodsId)
                .eq(BizGoodsAttribute::getAttrType, DbEnum.GoodsAttr.INTRODUCTION.getValue());
        return this.list(queryWrapper);
    }
    @Override
    public List<BizGoodsAttribute> getAttributeSTANDARDSByGoodsId(String goodsId){
        LambdaQueryWrapper<BizGoodsAttribute> queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.eq(BizGoodsAttribute::getGoodsId,goodsId)
                .eq(BizGoodsAttribute::getAttrType, DbEnum.GoodsAttr.STANDARDS.getValue());
        return this.list(queryWrapper);
    }
}




